<template>
  <ThemeAdaptPage class="demo-container">
    <div class="nav">
      <RouterLink to="demo-draw">画板</RouterLink>
      <RouterLink to="demo-icons">图标</RouterLink>
      <RouterLink to="demo-goods-card">商品卡片</RouterLink>
      <RouterLink to="demo-goods-list">商品列表</RouterLink>
    </div>
    <TextInput :err-message="errMessage" ref="rr" @update="update" v-model="aaa"></TextInput>
    <AfastButton @click="clear"></AfastButton>
    <RouterView></RouterView>
  </ThemeAdaptPage>
</template>
<script setup lang="ts">
import AfastButton from "@/components/a/AfastButton.vue";
import TextInput from "@/components/a/TextInput.vue";
import ThemeAdaptPage from "@/components/a/ThemeAdaptPage.vue";
import { ref } from "vue";
const aaa = ref('')
const errMessage = ref('')
const rr = ref()
const update = (v1, v2) => {
  console.log(v1, v2);
}
const clear = () => {
  errMessage.value = 'aaa'
}
</script>

<style lang="scss">
.demo-container {
  width: 100%;
  height: 100%;

  .nav {
    padding-left: 10px;
    width: 100%;
    display: flex;
    background: var(--blank-color);
    position: sticky;
    z-index: 1000;
    box-sizing: border-box;
    box-shadow: 1px 1px 10px #ededed;
    top: 0;
    box-sizing: border-box;

    >* {
      margin: 10px;
    }
  }

  .demo {
    padding: 10px;
    box-sizing: border-box;
  }

  .btns {
    display: flex;

    >*:not(:first-child) {
      margin-left: 5px;
    }
  }
}
</style>
